<?php

$fileID = $_REQUEST['file'];
if($fileID) {
	// Get file location
	$location = DB()->getVar("SELECT `upload_filename` FROM `cn_uploads` WHERE `upload_id`='$fileID'");
	DB()->query("DELETE FROM `cn_uploads` WHERE `upload_id`='$fileID'");
	
	unlink(CN_DOCUMENT_ROOT . 'uploads/'.$location);

	unset($_SESSION['wym_image_uploads'][$fileID]);
	
}